function initSite(){
	$("div.s_mp3 > a,div.s_mp3 div.mp3_describe > p > a,div.s_mp3 div.convert a.video").click(function() {
		$.fancybox({
			'padding'		: 10,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'			: 640,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
				'wmode'				: 'transparent',
				'allowfullscreen'	: 'true'
			}
		});

		return false;
	});
}


function parseMp3() {
	var url = $('#txtUrl').val();
	if (url == '') {
		return false;
	}
	
	var contextPath = $("#contextPath").val();
	if (!isYouTubeUrl(url)) {
		window.location = contextPath + '/search/' + url;
		return false;
	} else {
		var args = url.getArgs(url);
		var videoId = args.v;
		window.location = contextPath + '/convert/' + videoId;
	}
	return false;
};

function inputOnkeyup(event) {
	if (event.keyCode === 13) {
		parseMp3();
	}
}

